package com.huluobo.apps

import com.huluobo.apps.entity.AppsEntity
import com.huluobo.lib_base.BaseRepo
import com.huluobo.lib_base.Res
import com.huluobo.lib_http.HttpType
import com.huluobo.lib_http.NetworkFactory
import kotlinx.coroutines.flow.Flow
import javax.inject.Inject

/**
 *  Created by LC on 2025/6/23.
 *  @Inject constructor() : 使用之后,可以对外自动提供构造方法,也就是不需要再去new当前的Repo
 */
class AppsRepo @Inject constructor() : BaseRepo() {
    //获取apiService
    private val apiService by lazy { NetworkFactory.factory(HttpType.NONE).create(ApiService::class.java) }

    fun getApps(): Flow<Res<AppsEntity>> {
        return apiService.getAllApps()
    }
}